package com.kaifamiao.N0719;

public class Node2 {

    public static void main(String[] args) {

        int[] nums = {3, 5, 6, 3, 7, 0, 9, 5, 10};
        //求最大值，最小值，和。
        int x = nums[0];
        int y = nums[0];
        int z = 0;

        for (int i = 0; i < nums.length; i++) {
            if (nums[i] > x) {
                x = nums[i];
            }
            if (nums[i] < y) {
                y = nums[i];
            }
            z += nums[i];
        }
        System.out.println("最大值=" + x);
        System.out.println("最小值=" + y);
        System.out.println("求和=" + z);
    }
}

